import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/modules/autonym/pag/autonym_image/view.dart';

class AutonymTextLogic extends GetxController {
  /// 名字
  TextEditingController nameController = TextEditingController();

  /// 身份证号
  TextEditingController cardController = TextEditingController();

  /// 按钮是否可编辑
  RxBool enable = RxBool(false);

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    nameController.addListener(() {
      enable.value = (nameController.text.isNotEmpty && cardController.text.isNotEmpty);
    });
    cardController.addListener(() {
      enable.value = (nameController.text.isNotEmpty && cardController.text.isNotEmpty);
    });
  }

  /*
  * 按钮点击事件
  * */
  nextButtonAction() {
    Get.to(AutonymImagePage(), arguments: {
      "realName": nameController.text,
      "idCardNumber": cardController.text,
    });
  }
}
